<!doctype html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>钢链网-申请企业认证</title>
	<link rel="stylesheet" href="/resource/css/gl_index.css">
	<link rel="stylesheet" href="/resource/css/gl_user.css">
	<link rel="stylesheet" href="/resource/css/gl_showBo.css">

	<script src="/resource/js/jquery-1.11.3.min.js"></script>
	<script src="/resource/js/gl_index.js"></script>
	<script src="/resource/js/gl_showBo.js"></script>
	<script>
		$(function(){
			var sample_popup = '<div class=\"popup\"></div><div class=\"popup-sample\"></div>';
			$('body').after(sample_popup);
			$('.sample').click(function(e){
				var index = $(this)[0].className.match(/\d+\b/)[0];
				var img = "<img src=\"img/seller_"+index+".jpg\">";

				e?e.stopPropagation():event.cancelBubble = true;
				$('.popup').show();
				$('.popup-sample').html(img).show();
			});
			$(document).click(function(){
				$('.popup-sample').hide();
				$('.popup').hide();
			});

			$('input.form-control').after('<span></span>');
			$('.form-file').after('<span></span>');
			$('input[type="file"]').change(function(e){
				var file = $(this).get(0).files[0];
				if(!(/^image\/.*$/i.test(e.target.files[0].type))){
			        alert('请上传图片');           //不是图片 就跳出这一次循环
			        return false;
			    }
			    if (window.applicationCache) {
			    	if (file.name.length>9) {
			    		var str = file.name.substring(0,5)+file.name.substring(file.name.length-4,file.name.length);
			    		$(this).parents('.form-group').find('.img-name').html(str);
			    	}else{
			    		$(this).parents('.form-group').find('.img-name').html(file.name);
			    	};
			    }else{
			    	$(this).parents('.form-group').find('.img-name').html($(this).val());
			    	$(this).parents('.form-group').find('span').show().html('很抱歉，由于采用了HTML5，当前浏览器无法完美呈现该页面。');
			    };
				$(this).parents('.form-group').find('span').hide();
			});
			$('input.form-control').blur(function(){
				if(!$(this).val()){
					$(this).siblings('span').show().html('不能为空');
					return false;
				}else{
					$(this).siblings('span').hide();
				};
			});

			$(document).delegate('.btn-immed','click',function(){
				for (var i = 0; i < $('input.form-control').length; i++) {
					if(!$('input.form-control').eq(i).val()){
						$('input.form-control').eq(i).focus().siblings('span').show().html('不能为空');
						return false;
					};
				};
				if(!$('#operate_license').val()){
		            $('#operate_license').parents('.form-file').siblings('span').show().html("图片不能为空");
					return false;
				};
				if(!$('#organization').val()){
		            $('#organization').parents('.form-file').siblings('span').show().html("图片不能为空");
					return false;
				};
				if(!$('#tax_license').val()){
		            $('#tax_license').parents('.form-file').siblings('span').show().html("图片不能为空");
					return false;
				};
				if(!$('#account_licence').val()){
		            $('#account_licence').parents('.form-file').siblings('span').show().html("图片不能为空");
					return false;
				};
				Showbo.Msg.alert('<img src="/resource/img/gl_show_succ.png"><div style="color:#656464;font-size:24px;">申请已提交，请等待审核</div><div style="margin:15px 0 30px 0;font-size:14px;">如有问题，请联系400-036-7917</div>');
			});
		});
	</script>
</head>
<body>
<div class="head">
	<div class="head-top">
        @include('common.user_head')
	</div>
</div>
<div class="user-head">
	<div class="main">
		<div class="logo">
			<a href="/"><img src="/resource/img/logo.png" alt=""></a>
			<div>我的钢链网
				<a href="/">返回首页</a>
			</div>
		</div>
	</div>
</div>	
<div class="user main">
    @include('common.user_menu')
	<div class="user-cont">
		<div class="seller-join">
			<div class="title">申请企业认证</div>
            @if($status==3)
			<!-- 填写信息 -->
			<div class="join">
                @if(empty($info))
				<div class="prompt">温馨提示：请确认上传证件真实、有效、清晰，否则审核将不予通过</div>
				<div class="form">
					<form method="POST" action="/user_seller_join_info" accept-charset="UTF-8" enctype="multipart/form-data">
						<div class="form-group">
							<label for=""><i>*</i> 公司认证</label>
							<input type="text" class="form-control" placeholder="请输入公司名称" name="supplier_name" id="supplier_name">
						</div>
						<div class="form-group">
							<label for=""><i>*</i> 公司地址</label>
							<input type="text" class="form-control" placeholder="请输入公司地址" name="address" id="address">
						</div>
						<div class="form-group">
							<label for=""><i>*</i> 联系人</label>
							<input type="text" class="form-control" placeholder="请输入联系人" name="duty_name" id="duty_name">
						</div>
						<div class="form-group">
							<label for=""><i>*</i> 联系电话</label>
							<input type="text" class="form-control" placeholder="请输入联系电话" name="duty_mobile" id="duty_mobile">
						</div>
						<div class="form-group">
							<label for=""><i>*</i> 营业执照</label>
							<div class="form-file" id="">
								<label for="operate_license">选择图片</label>
								<input type="file" name="operate_license" accept="image/*" id="operate_license">
							</div>
							<div class="img-name left"></div>
							<a href="javascript:;" class="sample sample-1">样本</a>
						</div>
						<div class="form-group">
							<label for=""><i>*</i> 组织机构代码证</label>
							<div class="form-file" id="">
								<label for="organization">选择图片</label>
								<input type="file" name="organization" accept="image/*" id="organization">
							</div>
							<div class="img-name left"></div>
							<a href="javascript:;" class="sample sample-2">样本</a>
						</div>
						<div class="form-group">
							<label for=""><i>*</i> 税务登记证</label>
							<div class="form-file" id="">
								<label for="tax_license">选择图片</label>
								<input type="file" name="tax_license" accept="image/*" id="tax_license">
							</div>
							<div class="img-name left"></div>
							<a href="javascript:;" class="sample sample-3">样本</a>
						</div>
						<div class="form-group">
							<label for=""><i>*</i> 开户许可证</label>
							<div class="form-file" id="">
								<label for="account_licence">选择图片</label>
								<input type="file" name="account_licence" accept="image/*" id="account_licence">
							</div>
							<div class="img-name left"></div>
							<a href="javascript:;" class="sample sample-4">样本</a>
						</div>
						<input type="submit" class="btn-immed" value="提交申请">
					</form>
                    </div>
                    @else
                    <div class="prompt">请重新上传图片->温馨提示：请确认上传证件真实、有效、清晰，否则审核将不予通过</div>
                    <div class="form">
                        <form method="POST" action="/user_seller_join_info" accept-charset="UTF-8" enctype="multipart/form-data">
                            <input type="hidden" value="{{$info->supplier_id}}" name="supplier_id"/>
                            <div class="form-group">
                                <label for=""><i>*</i> 公司认证</label>
                                <input type="text" class="form-control" placeholder="请输入公司名称" name="supplier_name" id="supplier_name" value="{{$info->company}}">
                            </div>
                            <div class="form-group">
                                <label for=""><i>*</i> 公司地址</label>
                                <input type="text" class="form-control" placeholder="请输入公司地址" name="address" id="address" value="{{$info->address}}">
                            </div>
                            <div class="form-group">
                                <label for=""><i>*</i> 联系人</label>
                                <input type="text" class="form-control" placeholder="请输入联系人" name="duty_name" id="duty_name" value="{{$info->duty_name}}">
                            </div>
                            <div class="form-group">
                                <label for=""><i>*</i> 联系电话</label>
                                <input type="text" class="form-control" placeholder="请输入联系电话" name="duty_mobile" id="duty_mobile" value="{{$info->duty_mobile}}">
                            </div>
                            <div class="form-group">
                                <label for=""><i>*</i> 营业执照</label>
                                <div class="form-file" id="">
                                    <label for="operate_license">选择图片</label>
                                    <input type="file" name="operate_license" accept="image/*" id="operate_license">
                                </div>
                                <div class="img-name left"></div>
                                <a href="javascript:;" class="sample sample-1">样本</a>
                            </div>
                            <div class="form-group">
                                <label for=""><i>*</i> 组织机构代码证</label>
                                <div class="form-file" id="">
                                    <label for="organization">选择图片</label>
                                    <input type="file" name="organization" accept="image/*" id="organization">
                                </div>
                                <div class="img-name left"></div>
                                <a href="javascript:;" class="sample sample-2">样本</a>
                            </div>
                            <div class="form-group">
                                <label for=""><i>*</i> 税务登记证</label>
                                <div class="form-file" id="">
                                    <label for="tax_license">选择图片</label>
                                    <input type="file" name="tax_license" accept="image/*" id="tax_license">
                                </div>
                                <div class="img-name left"></div>
                                <a href="javascript:;" class="sample sample-3">样本</a>
                            </div>
                            <div class="form-group">
                                <label for=""><i>*</i> 开户许可证</label>
                                <div class="form-file" id="">
                                    <label for="account_licence">选择图片</label>
                                    <input type="file" name="account_licence" accept="image/*" id="account_licence">
                                </div>
                                <div class="img-name left"></div>
                                <a href="javascript:;" class="sample sample-4">样本</a>
                            </div>
                            <input type="submit" class="btn-immed" value="提交申请">
                        </form>
				</div>
                @endif
				<div class="join-info">
					<div class="til">企业用户须知</div>
					<ul>
						<li>1.您在入驻钢链网时需要提供您所在企业的营业执照、组织机构代码证、税务登记证、开户许可证，只支持3MB以下的jpg、gif、png、pdf、jpeg格式的图片或文件。</li>
						<li>2.您提交申请后会有资质审核人员在1--2个工作日内完成审核，审核通过后即可成为钢链网的企业用户，并可在平台交易商品</li>
					</ul>
				</div>
			</div>
            @elseif($status==2)
			<!-- 入驻审核中 -->
			<div class="seller-in">
				<div class="prompt">温馨提示：审核会在1-2个工作日内完成，我们将电话通知您</div>
				<div class="seller-progress">
					<img src="/resource/img/seller_in.png" alt="">
					<div>正在审核中</div>
				</div>
			</div>
            @elseif($status==0)
			<!-- 入驻审核未通过 -->
			<div class="seller-no">
				<div class="seller-progress">
					<img src="/resource/img/seller_no.png" alt="">
					<div>审核未通过</div>
				</div>
				<a href="/update_user_seller_join">重新认证</a>
			</div>
            @elseif($status==1)
			<!-- 入驻审核通过 -->
			 <div class="seller-after">
				<div class="seller-progress">
					<img src="/resource/img/seller_after.png" alt="">
					<div>审核已通过</div>
				</div>
				<div class="btn-box">
					<a href="/user_now_resource">上传资源单</a>
					<a href="/shopping">购买钢材</a>
				</div>
			</div>
                @endif
		</div>
	</div>
</div>
@include('common.shop_foot')
</body>
</html>